﻿


using System;
using System.Text;
using System.Collections;
using System.Xml;
using System.Data;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Resources;
using System.Reflection;
using System.Globalization;
using System.Threading;

using Telerik.WebControls;
using UFSoft.UBF.UI.WebControls;
using UFSoft.UBF.UI.WebControls.InterActionComponenet;
using UFSoft.UBF.Util.Log;
using UFSoft.UBF.Util.Context;

//using MagicAjax.UI.Controls;
using UFSoft.UBF.Report.UI.ReportView.Web;
using UFSoft.UBF.UI.WebControlAdapter;
using UFSoft.UBF.UI.FormProcess;
using UFSoft.UBF.UI.IView;
using UFSoft.UBF.UI.Engine;
using UFSoft.UBF.UI.Engine.Builder;
using UFSoft.UBF.UI.Engine.Authorization;
using UFSoft.UBF.UI.MD.Runtime;
using UFSoft.UBF.UI.ActionProcess;
using UFSoft.UBF.UI.ControlModel;
using UFSoft.UBF.UI.Controls;
using UFSoft.UBF.UI.WebControls.Association;
using UFSoft.UBF.UI.WebControls.ClientCallBack;
using System.Web.UI;
using UFSoft.UBF.UI.UIFormPersonalization;
using System.Collections.Specialized;


/***********************************************************************************************
 * Form ID:50840e51-8dae-4f06-8681-14c16b47be33 
 * Form Name:UserDefAllocRateConfigListUIForm
 * UIFactory Auto Generator
 ***********************************************************************************************/
namespace UFIDA.U9.Cust.OTD.ZF.SHXM3003.OTDListUI.UserDefAllocRateConfigListUIModel
{
	[FormRegister("UFIDA.U9.Cust.OTD.ZF.SHXM3003.OTDListUI","UFIDA.U9.Cust.OTD.ZF.SHXM3003.OTDListUI.UserDefAllocRateConfigListUIModel.UserDefAllocRateConfigListUIFormWebPart", "UFIDA.U9.Cust.OTD.ZF.SHXM3003.OTDListUI.WebPart", "50840e51-8dae-4f06-8681-14c16b47be33","WebPart", "True", 992, 504)] 
	///insert into aspnet_Parts (SysVersion, Path, ClassName, [Assembly], FormId) values (0, 'UFIDA.U9.Cust.OTD.ZF.SHXM3003.OTDListUI', 'UFIDA.U9.Cust.OTD.ZF.SHXM3003.OTDListUI.UserDefAllocRateConfigListUIModel.UserDefAllocRateConfigListUIFormWebPart', 'UFIDA.U9.Cust.OTD.ZF.SHXM3003.OTDListUI.WebPart', '50840e51-8dae-4f06-8681-14c16b47be33')
	///<siteMapNode url="~/erp/simple.aspx?lnk=50840e51-8dae-4f06-8681-14c16b47be33" title="UserDefAllocRateConfigListUIForm"/>
    public partial class UserDefAllocRateConfigListUIFormWebPart : UFSoft.UBF.UI.FormProcess.BaseWebForm
    {
		#region Page Controller/Code Behind
        private static readonly ILogger logger = LoggerManager.GetLogger(typeof(UserDefAllocRateConfigListUIFormWebPart));
        private string assemblyName = System.Reflection.Assembly.GetExecutingAssembly().FullName;
        //private string displayNamePostfix = "displayName";

		#region 强类型化基类属性.
		public new UserDefAllocRateConfigListUIModelAction Action
		{
			get { return (UserDefAllocRateConfigListUIModelAction)base.Action; }
			set { base.Action = value; }
		}
		UserDefAllocRateConfigListUIModelModel _uimodel=null;
		public new UserDefAllocRateConfigListUIModelModel Model
		{
			get 
			{
			     if(_uimodel == null){
			          _uimodel = new UserDefAllocRateConfigListUIModelModel();
			     }
			     return _uimodel; 
			}
			set { _uimodel = value; }
		}
        protected override IUIModel UIModel{
            get{
                return this.Model;
            }
            set{
                this.Model = value as UserDefAllocRateConfigListUIModelModel;
            }
        }
		#endregion 
		public FormAdjust adjust;
        #region variable declaration
        IUFToolbar Toolbar2;
        IUFButton BtnSave;
        IUFButton BtnCancel;
        IUFCard Card0;
        IUFButton BuildDistributionBase;
        IUFButton BtnHD;
        IUFCard Card3;
        IUFDataGrid DataGrid1;
		UpdatePanel updatePanel;
		HiddenField wpFindID;
		IUFContainer topLevelPanel;     
        IUFSeparator SeparatorInFavorites;
        IUFButton BtnDefaultValues;
        #endregion
        
        #region constructor
        public UserDefAllocRateConfigListUIFormWebPart()
        {
            FormID = "50840e51-8dae-4f06-8681-14c16b47be33";
            IsAutoSize = bool.Parse("True");
            NewIsAutoSize = bool.Parse("False");
        }
        #endregion


	
            
	//获取档案版型结果: 

        #region eventBind and databind
        private void EventBind()
        {
			//事件绑定模板
				//Button控件事件
			this.BtnSave.Click += new EventHandler(BtnSave_Click);		
						
				//Button控件事件
			this.BtnCancel.Click += new EventHandler(BtnCancel_Click);		
						
				//Button控件事件
			this.BuildDistributionBase.Click += new EventHandler(BuildDistributionBase_Click);		
						
				//Button控件事件
			this.BtnHD.Click += new EventHandler(BtnHD_Click);		
						

	
			//Grid控件的分页事件				
			((UFWebDataGridAdapter)this.DataGrid1).GridMakePageEventHandler += new GridMakePageDelegate(UFGridDataGrid1_GridMakePageEventHandler);
             //Grid控件的客户化筛选，定位事件
            ((UFWebDataGridAdapter)this.DataGrid1).GridCustomFilterHandler += new GridCustomFilterDelegate(UFGridDataGrid1_GridCustomFilterHandler);

            AfterEventBind();
        }
        #endregion            
        
		#region override method
		protected override void OnLoad(EventArgs e)
		{
			base.OnLoad2(e);
		}
		protected override void OnLoadDataDo(EventArgs e)
		{
		    adjust.ProcessAdjustBeforeOnLoad(this);
			if (UIEngineHelper.IsDataBind(PageStatus, this))
			{
				if(this.Model==null){				        
					this.Model = new UserDefAllocRateConfigListUIModelModel();
				}
				OnLoadConsumer(new InParameterModel[]{},new InParameterModel[]{});
				OnLoadData(this);
				this.IsDataBinding = true ; //加载完数据要绑定一次.目前加这.
			}
			else
			{
				//去除.已经移入到OnInit()中.
				//this.Model = (UserDefAllocRateConfigListUIModelModel)this.CurrentState[this.TaskId.ToString()];
			}
			adjust.ProcessAdjustAfterOnLoadData(this);
		            AfterOnLoad();
            
            adjust.ProcessAdjustAfterOnLoad(this);
		}
		protected override void OnPreRender(EventArgs e)
		{
			base.OnPreRender2(e);
		}
        protected override void OnPreRenderDo(EventArgs e)
        {
            adjust.ProcessAdjustBeforeOnPreRender(this);
			base.OnPreRender(e);
			this.CurrentState[this.TaskId.ToString()] = this.Model;
			RegisterClearWebPartPadding();
            UFIDA.U9.UI.PDHelper.FormAuthorityHelper.SetWebPartAuthorization(this);
            
			if (IsDataBinding) //2006-9-7 可由开发人员控制
			{
				BeforeUIModelBinding();
								if(!Page.IsPostBack)
				{
					EnumTypeBinding.BindEnumControls(this);
				}
				UFIDA.U9.UI.Commands.CommandHelper.BindFlexData(this);
				adjust.ProcessAdjustBeforeDataBinding(this);
				if (this.IsOnlyDataBinding)
				{
					this.DataBinding();
				}
				adjust.ProcessAdjustAfterDataBinding(this);

				AfterUIModelBinding();
			}
			adjust.ProcessAdjustAfterOnPreRender(this);
        }
		protected override void OnInit(EventArgs e)
		{
			base.OnInit2(e);
		}
		protected override void OnInitDo(EventArgs e)
		{			 
			this.Page.InitComplete += new EventHandler(Page_InitComplete);
			WebPartBuilder.InitWebPart(this);
            this.Action = new UserDefAllocRateConfigListUIModelAction(this);
            adjust = new FormAdjust();
		    CreateFormChildControls();
		}
        void Page_InitComplete(object sender, EventArgs e)
        {

            adjust.ProcessInit(this);
        }
        #endregion

      
        
        #endregion

	
		/// <summary>
        /// WebPart View
        /// </summary>
        #region view Create Contorls
        private void CreateFormChildControls()
        {
            IUFContainer _panel = UIControlBuilder.BuildTopLevelContainer(this,"UserDefAllocRateConfigListUIForm",true,992,504);
            CommonBuilder.ContainerGridLayoutPropBuilder(_panel, 1, 3, 0, 10, 0, 0, 0, 5);
			InitViewBindingContainer(this, _panel,  null, "", "", null, 1, "");
			UIControlBuilder.BuildContainerGridLayout(_panel, 10,new GridColumnDef[]{new GridColumnDef(992,bool.Parse("False"),"Title"),},new GridRowDef[]{new GridRowDef(28,bool.Parse("True")),new GridRowDef(421,bool.Parse("False")),new GridRowDef(25,bool.Parse("True")),});
            //???还有用么?
            topLevelPanel = _panel;    
            
            UIControlBuilder.BuildCommonControls(this,ref updatePanel,ref wpFindID);
            





	
			_BuilderControl_Toolbar2(_panel);

		
			UIControlBuilder.BuilderUFControl(this.Toolbar2, "1");		


	
			_BuilderControl_Card0(_panel);

		
			UIControlBuilder.BuilderUFControl(this.Card0, "3");		


	
			_BuilderControl_Card3(_panel);

		
			UIControlBuilder.BuilderUFControl(this.Card3, "2");		



			
     
			
			
            EventBind();
            AfterCreateChildControls();
            
        }        







				        
        private void _BuilderControl_Toolbar2(IUFContainer container)
        {
            IUFToolbar _Toolbar = UIControlBuilder.BuilderToolBarControl(container,"Toolbar2",true, true, "1",992, 28, 0, 0, 1, 1,"100");
            this.Toolbar2 = _Toolbar;
            
            ///foreach Toolbar下的所有控件，增加到此容器
                            this.BtnSave = UIControlBuilder.BuilderToolbarButton(_Toolbar, "True", "BtnSave", "True", "True", 35, 28,"1", "",true,false,"8288c5a3-3b19-48d3-b139-f7018d2782ee","8288c5a3-3b19-48d3-b139-f7018d2782ee","3eb6f44e-e3b1-4583-a33c-b6454a588110");
		
            UIControlBuilder.SetButtonAccessKey(this.BtnSave);
            this.BtnSave.UIModel = this.Model.ElementID;
            this.BtnSave.Action = "SaveClick";
	                            this.BtnCancel = UIControlBuilder.BuilderToolbarButton(_Toolbar, "True", "BtnCancel", "True", "True", 35, 28,"2", "",true,false,"f35cb480-9e8f-4689-aaac-3e9fc9a0c65e","f35cb480-9e8f-4689-aaac-3e9fc9a0c65e","92e5107c-e36a-40d7-a02c-09718846ba21");
		
            UIControlBuilder.SetButtonAccessKey(this.BtnCancel);
            this.BtnCancel.UIModel = this.Model.ElementID;
            this.BtnCancel.Action = "CancelClick";
	
            
            ((UFWebToolbarAdapter)_Toolbar).RemoveControls();
        }



	                   
        private IUFCard _BuilderControl_Card0(IUFContainer container)
        {
            IUFCard _UFCard = UIControlBuilder.BuildCard(container,"Card0",false,"FunctionBar", true, true, "3","","894b87b8-b612-4f43-9b15-0024c11b5d17");
			CommonBuilder.GridLayoutPropBuilder(container, _UFCard, 992, 25, 0, 2, 1, 1, "100");
            CommonBuilder.ContainerGridLayoutPropBuilder(_UFCard, 22, 1, 0, 5, 10, 3, 10, 2);
			InitViewBindingContainer(this, _UFCard,  null, "", "", null, 1, "");
			UIControlBuilder.BuildContainerGridLayout(_UFCard, 5,new GridColumnDef[]{new GridColumnDef(80,bool.Parse("True"),"Spacing"),new GridColumnDef(10,bool.Parse("True"),"Spacing"),new GridColumnDef(80,bool.Parse("True"),"Spacing"),new GridColumnDef(10,bool.Parse("True"),"Spacing"),new GridColumnDef(80,bool.Parse("True"),"Spacing"),new GridColumnDef(10,bool.Parse("True"),"Spacing"),new GridColumnDef(80,bool.Parse("True"),"Spacing"),new GridColumnDef(10,bool.Parse("True"),"Spacing"),new GridColumnDef(80,bool.Parse("True"),"Spacing"),new GridColumnDef(10,bool.Parse("True"),"Spacing"),new GridColumnDef(80,bool.Parse("True"),"Spacing"),new GridColumnDef(10,bool.Parse("True"),"Spacing"),new GridColumnDef(80,bool.Parse("True"),"Spacing"),new GridColumnDef(10,bool.Parse("True"),"Spacing"),new GridColumnDef(80,bool.Parse("True"),"Spacing"),new GridColumnDef(10,bool.Parse("True"),"Spacing"),new GridColumnDef(71,bool.Parse("True"),"Value"),new GridColumnDef(10,bool.Parse("True"),"Spacing"),new GridColumnDef(80,bool.Parse("True"),"Spacing"),new GridColumnDef(10,bool.Parse("True"),"Spacing"),new GridColumnDef(80,bool.Parse("True"),"Spacing"),new GridColumnDef(1,bool.Parse("False"),"Spacing"),},new GridRowDef[]{new GridRowDef(20,bool.Parse("True")),});
            this.Card0 = _UFCard;

            ///foreach UFCard下的所有控件，增加到此容器





				this.BuildDistributionBase = UIControlBuilder.BuilderUFButton(_UFCard, true, "BuildDistributionBase", true, true, 80, 20, 0, 0, 1, 1, "100","", this.Model.ElementID,"BuildDistributionBase",false,"317fda17-bc24-4292-8003-7cc675e02e1a","317fda17-bc24-4292-8003-7cc675e02e1a","59bdde3c-6ec5-4292-a2b7-33a167be2e8e");
	

		
			UIControlBuilder.BuilderUFControl(this.BuildDistributionBase, "0");		


				this.BtnHD = UIControlBuilder.BuilderUFButton(_UFCard, true, "BtnHD", true, false, 80, 20, 0, 0, 1, 1, "100","", this.Model.ElementID,"",false,"304a6029-6624-413f-b745-bf70c02554cd","","304a6029-6624-413f-b745-bf70c02554cd");
	

		
			UIControlBuilder.BuilderUFControl(this.BtnHD, "1");		



		

            
            container.Controls.Add(_UFCard);
            return _UFCard;
        }

	                   
        private IUFCard _BuilderControl_Card3(IUFContainer container)
        {
            IUFCard _UFCard = UIControlBuilder.BuildCard(container,"Card3",false,"none", true, true, "2","","3e674f20-84e3-4390-b48d-b9e1111fd5f7");
			CommonBuilder.GridLayoutPropBuilder(container, _UFCard, 992, 421, 0, 1, 1, 1, "100");
            CommonBuilder.ContainerGridLayoutPropBuilder(_UFCard, 2, 2, 0, 5, 10, 0, 10, 0);
			InitViewBindingContainer(this, _UFCard,  null, "", "", null, 1, "");
			UIControlBuilder.BuildContainerGridLayout(_UFCard, 5,new GridColumnDef[]{new GridColumnDef(971,bool.Parse("True"),"Value"),new GridColumnDef(1,bool.Parse("False"),"Spacing"),},new GridRowDef[]{new GridRowDef(415,bool.Parse("True")),new GridRowDef(1,bool.Parse("False")),});
            this.Card3 = _UFCard;

            ///foreach UFCard下的所有控件，增加到此容器





	
			_BuilderControl_DataGrid1(_UFCard);

		
			UIControlBuilder.BuilderUFControl(this.DataGrid1, "1");		



	

            
            container.Controls.Add(_UFCard);
            return _UFCard;
        }

				





       
        private void _BuilderControl_DataGrid1(IUFContainer container)
        {
            IUFDataGrid _UFGrid = UIControlBuilder.BuildGridControl("DataGrid1", UFSoft.UBF.UI.ControlModel.EditStatus.Edit, true, true,true,true,true,true,20,false, false) ;
  			UIControlBuilder.BuilderUFControl(_UFGrid, "True", "True", "1");
			CommonBuilder.GridLayoutPropBuilder(container, _UFGrid, 972, 421, 0, 0, 2, 2, "100");
			InitViewBindingContainer(this, _UFGrid,  this.Model.UserDefAllocRateConfig, "UserDefAllocRateConfig", "", null, 20, "分配基数配置");
			((UFSoft.UBF.UI.WebControlAdapter.UFWebDataGridAdapter)_UFGrid).PagingStrategy=UFSoft.UBF.UI.ControlModel.GridPagingStrategy.Auto;
			_UFGrid.AllowSelectAllPage=false;
			((UFSoft.UBF.UI.WebControls.UFGrid)_UFGrid).IsSumAllData=false;
		        ((UFSoft.UBF.UI.WebControls.UFGrid)_UFGrid).IsSumSelectedData=false;
            this.DataGrid1 = _UFGrid;
            container.Controls.Add(_UFGrid);



			IUFDataGridColumn column ;
			GridColumn gridColumn ;
	                     
			column = GridControlBuilder.GridColumnBuilder(_UFGrid,"ID0","NumberColumnModel", "", 0,this.Model.UserDefAllocRateConfig.Fields["ID"]/*ID*/,"ID", true, false, true, false, false, false, 7, 100, "19.0",true, false,"","9af1f7ba-7be2-4d40-8d60-e2e593e4ff47","9af1f7ba-7be2-4d40-8d60-e2e593e4ff47","ce45ca04-8845-4adb-aa60-d281b7938327");
			GridControlBuilder.GridNumberColumnBuilder((IUFNumberColumn)column, NumbericType.Numberic, 79228162514264337593543950335m, -79228162514264337593543950335m, null, null, null, null
			,true,"",false,"1","1");
	  
		 	                     
			column = GridControlBuilder.GridColumnBuilder(_UFGrid,"SysVersion0","NumberColumnModel", "", 0,this.Model.UserDefAllocRateConfig.Fields["SysVersion"]/*SysVersion*/,"SysVersion", false, false, true, false, false, true, 7, 100, "19.0",true, false,"0","7db81f5e-f8d4-4dbf-869b-0a76572fe089","7db81f5e-f8d4-4dbf-869b-0a76572fe089","2464083e-30a6-4c5f-aded-32ba19f71eb8");
			GridControlBuilder.GridNumberColumnBuilder((IUFNumberColumn)column, NumbericType.Numberic, 79228162514264337593543950335m, -79228162514264337593543950335m, null, null, null, null
			,true,"",false,"1","1");
	  
		 	                     
			column = GridControlBuilder.GridColumnBuilder(_UFGrid,"UserDefAllocRateCode0","ReferenceColumnModel", "", 0,this.Model.UserDefAllocRateConfig.Fields["UserDefAllocRateCode"]/*UserDefAllocRateCode*/,"UserDefAllocRateCode", false, true, true, false, false, true, 7, 140, "19.0",true, false,"","82fc7603-593d-4b43-b865-828dd6ec889f","82fc7603-593d-4b43-b865-828dd6ec889f","32820d3b-2a63-4486-a703-4780cc7c20bd");
			GridControlBuilder.GridReferenceColumnBuilder((IUFFldReferenceColumn)column, ColumnTextAlign.Right, "ID", "Code", "Name", this.Model.UserDefAllocRateConfig.FieldUserDefAllocRateCode_Code/*UserDefAllocRateCode_Code*/, this.Model.UserDefAllocRateConfig.FieldUserDefAllocRateCode_Code/*UserDefAllocRateCode_Code*/, "beedebc3-5398-46b5-a237-5a3a4d13ad4f"
			,false,true,580,408);
            ((IUFFldReferenceColumn)column).CtrlId = "32820d3b-2a63-4486-a703-4780cc7c20bd";
 			((IUFFldReferenceColumn)column).IsMultiOrg  = false ;
           //foreach Reference's input filter parameter

            //foreach Reference's output set data
							
							
            ((IUFFldReferenceColumn)column).RefRelations.Add(new UFRefRelationAdapter("Code", "UserDefAllocRateCode", "Value"));
							
            ((IUFFldReferenceColumn)column).RefRelations.Add(new UFRefRelationAdapter("Name", "UserDefAllocRateName", "Value"));
							
							
							
							
							
							
							
							
							
							
							
							
							
            ((IUFFldReferenceColumn)column).ApplyRefRelations();
			  
		 	                     
			column = GridControlBuilder.GridColumnBuilder(_UFGrid,"UserDefAllocRateName0","TextBoxColumnModel", "", 0,this.Model.UserDefAllocRateConfig.Fields["UserDefAllocRateName"]/*UserDefAllocRateName*/,"UserDefAllocRateName", false, true, true, false, false, true, 0, 140, "50",true, false,"","7a7b45a9-0bfa-4e53-91ff-04037216ecf7","7a7b45a9-0bfa-4e53-91ff-04037216ecf7","9407c714-d6cc-4c6d-9ddf-b70f1ec2806c");
         
			GridControlBuilder.GridTextBoxColumnBuilder((IUFTextBoxColumn)column,"",TextAlign.Left, false,"",false,"1","1","50") ;          
	  
		 	                     
			column = GridControlBuilder.GridColumnBuilder(_UFGrid,"Remark0","TextBoxColumnModel", "", 0,this.Model.UserDefAllocRateConfig.Fields["Remark"]/*Remark*/,"Remark", false, true, true, false, false, true, 0, 100, "50",true, false,"","0f0be363-cdf6-4be9-ad22-55cfee4150c3","0f0be363-cdf6-4be9-ad22-55cfee4150c3","a375d1ad-d446-4b95-9e3d-1ecd8913152a");
         
			GridControlBuilder.GridTextBoxColumnBuilder((IUFTextBoxColumn)column,"",TextAlign.Left, false,"",false,"1","1","50") ;          
	  
		 
        }





		#endregion
		

	}
}
